﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CheccCoverplateCulvertAssemble.Common.Total
{
    /// <summary>
    /// 帽石
    /// </summary>
    public class CommonCapStone : MyNotifyPropertyChanged
    {
        private CapStoneBase _capStoneLeft = new CapStoneBase();
        private CapStoneBase _capStoneRight = new CapStoneBase();

        public CommonCapStone()
        {
        }

        public CommonCapStone(CapStoneBase capStoneLeft, CapStoneBase capStoneRight)
        {
            CapStoneLeft = capStoneLeft;
            CapStoneRight = capStoneRight;
        }

        /// <summary>
        /// 左帽石参数
        /// </summary>
        public CapStoneBase CapStoneLeft
        {
            get
            {
                return _capStoneLeft;
            }
            set
            {
                if (value == _capStoneLeft)
                    return;
                _capStoneLeft = value;
                NotifyPropertyChanged(() => CapStoneLeft);
            }
        }
        /// <summary>
        /// 右帽石参数
        /// </summary>
        public CapStoneBase CapStoneRight
        {
            get
            {
                return _capStoneRight;
            }
            set
            {
                if (value == _capStoneRight)
                    return;
                _capStoneRight = value;
                NotifyPropertyChanged(() => CapStoneRight);
            }
        }
    }
    public class CapStoneBase : MyNotifyPropertyChanged
    {
        private double _width;
        private double _chamfering;
        private double _height;
        private double _outQuantity;
        private string _material;

        public CapStoneBase()
        {
        }

        public CapStoneBase(double width, double chamfering, double height, double outQuantity, string material)
        {
            Width = width;
            Chamfering = chamfering;
            Height = height;
            OutQuantity = outQuantity;
            Material = material;
        }

        /// <summary>
        /// 帽石宽度
        /// </summary>
        public double Width
        {
            get
            {
                return _width;
            }
            set
            {
                if (value == _width)
                    return;
                _width = value;
                NotifyPropertyChanged(() => Width);
            }
        }

        /// <summary>
        /// 帽石倒角
        /// </summary>
        public double Chamfering
        {
            get
            {
                return _chamfering;
            }
            set
            {
                if (value == _chamfering)
                    return;
                _chamfering = value;
                NotifyPropertyChanged(() => Chamfering);
            }
        }

        /// <summary>
        /// 帽石高度
        /// </summary>
        public double Height
        {
            get
            {
                return _height;
            }
            set
            {
                if (value == _height)
                    return;
                _height = value;
                NotifyPropertyChanged(() => Height);
            }
        }

        /// <summary>
        /// 帽石悬出量
        /// </summary>
        public double OutQuantity
        {
            get
            {
                return _outQuantity;
            }
            set
            {
                if (value == _outQuantity)
                    return;
                _outQuantity = value;
                NotifyPropertyChanged(() => OutQuantity);
            }
        }

        /// <summary>
        /// 帽石材料
        /// </summary>
        public string Material
        {
            get
            {
                return _material;
            }
            set
            {
                if (value == _material)
                    return;
                _material = value;
                NotifyPropertyChanged(() => Material);
            }
        }
    }
}
